import request from '@/utils/request'
let baseUrl =
  process.env.NODE_ENV === 'production'
    ? 'api/finance-store/std'
    : '/finance-store'
export const getOrgList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/organization/list',
    method: 'post',
    data
  })
export const createOrg = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/organization/create',
    method: 'post',
    data
  })
export const updateOrg = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/organization/update',
    method: 'post',
    data
  })
export const deleteOrg = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/organization/delete',
    method: 'post',
    data
  })
// 客户经理管理
export const customerManagerList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/customer-manager/list',
    method: 'post',
    data
  })
export const customerManagerDetail = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/customer-manager/detail',
    method: 'post',
    data
  })
export const createCustomerManager = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/customer-manager/create',
    method: 'post',
    data
  })
export const updateCustomerManager = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/customer-manager/update',
    method: 'post',
    data
  })
export const deleteCustomerManager = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/customer-manager/delete',
    method: 'post',
    data
  })

// 获取店铺详情
export const getShopInfo = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/customer-manager-shop/detail',
    method: 'post',
    data
  })

// 装修店铺
export const setShopInfo = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/customer-manager-shop/update-or-create',
    method: 'post',
    data
  })

// 上传文件
export const uploadFile = (data?: any) =>
  request({
    baseURL: baseUrl,
    method: 'post',
    url: '/customer-manager-shop/upload-img',
    data
  })

// 产品管理
export const productList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/product/list',
    method: 'post',
    data
  })
export const createProduct = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/product/create',
    method: 'post',
    data
  })
export const updateProduct = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/product/update',
    method: 'post',
    data
  })
export const productDetail = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/product/detail',
    method: 'post',
    data
  })
// 客户经理对应的客户列表
export const customerManagerUserList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/user/list',
    method: 'post',
    data
  })
export const userNote = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/user/note',
    method: 'post',
    data
  })
export const customerDetail = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/user/detail',
    method: 'post',
    data
  })
// 预约列表
export const customerManagerUserAppointmentList = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/user-appointment/list',
    method: 'post',
    data
  })
export const userAppointmentNote = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/user-appointment/note',
    method: 'post',
    data
  })
export const appointmentDetail = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/user-appointment/detail',
    method: 'post',
    data
  })
export const appointmentTransform = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/user-appointment/transform',
    method: 'post',
    data
  })

// 获取客户经理详情
export const getManagerInfo = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/customer-manager/detail',
    method: 'post',
    data
  })
